package com.java.vo;

/**
 * 方法执行返回状态类
 */
public class Result {
	
	private boolean status;
	
	private String msg;
	
	private Object data;
	
	public boolean isStatus() {
		return status;
	}
	
	public void setStatus(boolean status) {
		this.status = status;
	}
	
	public String getMsg() {
		return msg;
	}
	
	public Object getData() {
		return data;
	}
	
	public void setData(Object data) {
		this.data = data;
	}
	
	public void setMsg(String msg) {
		this.msg = msg;
	}
	
	public Result fail(String msg) {
		return fail(msg, null);
	}
	
	public Result fail(String msg, Object data) {
		this.status = false;
		this.msg = msg;
		this.data = data;
		return this;
	}
	
	public Result success(String msg) {
		return success(msg, null);
	}
	
	public Result success(String msg, Object data) {
		this.status = true;
		this.msg = msg;
		this.data = data;
		return this;
	}
	
	

}
